home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / editor / frexxed / fpl / swapbuffer.fpl < prev    next >
Text File  |  1995-07-27  |  1KB  |  48 lines

  1. export void SwapBuffer(int direction)
  2. {
  3.   int oldbuffer=GetBufferID();
  4.   int newentry;
  5.  
  6.   if (ReadInfo("buffers")>1) {
  7.     if (direction)
  8.       newentry=NextBuffer(oldbuffer, ReadInfo("type"));
  9.     else
  10.       newentry=PrevBuffer(oldbuffer, ReadInfo("type"));
  11.  
  12.     if (newentry!=oldbuffer) {
  13.       if (ReadInfo("visible", newentry))
  14.         newentry=DuplicateEntry(newentry);
  15.       Activate(newentry, 0);
  16.       if (ReadInfo("shared")>1) {
  17.         Visible(0);
  18.         Kill();
  19.       }
  20.       CurrentBuffer(newentry);
  21.       Visible(1);
  22.     }
  23.   }
  24. }
  25. export void GetBuffer()
  26. {
  27.   int newentry;
  28.  
  29.   if (ReadInfo("buffers")>1) {
  30.     newentry=PromptBuffer("Select buffer", 1);
  31.  
  32.     if (ReadInfo("visible", newentry))
  33.       newentry=DuplicateEntry(newentry);
  34.  
  35.     Activate(newentry);
  36.  
  37.     if (ReadInfo("shared")>1) {
  38.       Visible(0);
  39.       Kill();
  40.     }
  41.     CurrentBuffer(newentry);
  42.     Visible(1);
  43.   }
  44. }
  45. AssignKey("SwapBuffer(0);", "Alt 'Left'");
  46. AssignKey("SwapBuffer(1);", "Alt 'Right'");
  47. AssignKey("GetBuffer();", "Amiga G");
  48.